<template>
  <div class="container">
    <div v-show="!showNoRecord">
      <!-- <div class="am-ft-center am-ft-xl">
          <p>广东省妇幼保健院</p>
          <p>广东省儿童医院</p>
          <p>广东省妇产医院</p>
        </div> -->
      <div class="weui_cells_title">下单时间：{{createDt}}</div>
      <div class="weui_cells">
        <div class="weui_cell">
          <div class="weui_cell_bd weui_cell_primary">
            <p>
              <span class="label">订&nbsp;&nbsp;单&nbsp;&nbsp;号</span>
              <span class="info">{{num}}</span>
            </p>
          </div>
        </div>
        <div class="weui_cell">
          <div class="weui_cell_bd weui_cell_primary">
            <p>
              <span class="label">姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名</span>
              <span class="info">{{patientName}}</span>
            </p>
          </div>
        </div>
        <div class="weui_cell">
          <div class="weui_cell_bd weui_cell_primary">
            <p>
              <span class="label">住&nbsp;&nbsp;院&nbsp;&nbsp;号</span>
              <span class="info">{{wardNo}}</span>
            </p>
          </div>
        </div>
      </div>
      <div class="weui_cells">
        <div class="weui_cell">
          <div class="weui_cell_bd weui_cell_primary">
            <p>
              <span class="label">金&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;额</span>
              <span class="info">{{prepayMoney}} 元</span>
            </p>
          </div>
        </div>
      </div>
      <div style="padding-top:20px;">
        <figure style="margin: 0.2em 0.5em;">
          <img style="width: 100%;" src="../../assets/img/nonghangerweima.jpg" />
        </figure>
      </div>
      <p style="align-content: center;">长按图片关注中国农业银行顺德分行微信公众号</p>
    </div>
    <div v-show="showNoRecord">
      <div class="weui_msg">
        <div class="weui_icon_area"><i class="weui_icon_warn weui_icon_msg"></i></div>
        <div class="weui_text_area">
          <h2 class="weui_msg_title">找不到住院预缴单</h2>
          <p class="weui_msg_desc">
            该住院预缴单不存在
          </p>
        </div>
        <div class="weui_opr_area">
          <p class="weui_btn_area">
            <a href="javascript:;" @click="gotoPortal" class="weui_btn weui_btn_primary">返回首页</a>
          </p>
        </div>
      </div>
    </div>
    <partial name="footer-copyright"></partial>
  </div>
</template>
<style scoped>
span.label {
  display: inline-block;
  width: 80px;
}

span.info {
  color: #0ae;
}

.weui_icon_warn.weui_icon_msg:before {
  color: #a5a5a5;
}
</style>
<script>
export default {
  name: 'PrepayOrderDetailView',
  data: function () {
    return {
      id: -1,
      num: '',
      wardNo: '',
      patientName: '',
      createDt: '',
      prepayMoney: '',
      failedMsg: '',
      showNoRecord: false
    }
  },
  methods: {
    getOrderDetail: function () {
      var self = this
      this.$ajax.get('GetPrepayOrderDetail', 'Inpatient', { orderId: this.id }).then(function (data) {
        if (data.ResultCode === '0') {
          self.num = data.OrderNo
          self.wardNo = data.WardNo
          self.patientName = data.PatientName
          self.createDt = data.CreateDt
          self.prepayMoney = data.PrepayMoney
        } else {
          self.showNoRecord = true
        }
      })
    },
    gotoPortal: function () {
      this.$router.replace({ name: 'portal' })
    }
  },
  ready: function () {
    this.id = this.$route.params.orderId
    this.getOrderDetail()
  }
}
</script>
